﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Automted_Bank_teller
{
    class Profile_logic : Profile_Process
    {

        public string return_fname()
        {
            return fname;
        }

        public string return_mName()
        {
            return mname;
        }

        public string return_lname()
        {
            return lname;
        }
        public string return_phone()
        {
            return phone;
        }
        public string return_address()
        {
            return address;
        }
        public string return_government()
        {
            return governmnet;
        }
        public string return_city()
        {
            return city;
        }
        public string return_email()
        {
            return email;
        }
        public string retun_ssn()
        {
            return ssn;
        }
        public string return_cId()
        {
            return client_id;
        }
        
        public float return_balance()
        {
            return balance;
        }


        public void GetUpdatedINfoFromClient(string CLNT_PHONE, string CLNT_EMAIL, string CLNT_CITY, string CLNT_GOVERNMENT, string CLNT_ADDRESS)
        {
            C_phone_no = CLNT_PHONE;
            C_mail = CLNT_EMAIL;
            C_city = CLNT_CITY;
            C_gonvernment = CLNT_GOVERNMENT;
            C_address = CLNT_ADDRESS;

        }


        public void makeSureDataUpdated()
        {
            if (email.Length > 0 && phone.Length > 0 && city.Length > 0 && address.Length > 0 && governmnet.Length > 0)
            {

                if (Convert.ToBoolean(cmd.ExecuteNonQuery()))
                {
                    MessageBox.Show("Data updated successfully");
                    connect.Close();

                }
                else
                {
                    MessageBox.Show("error Occured.Changes discarded");
                }
            }
        }

    }
}
